#include "defaultmessagebox.h"
#include "ui_defaultmessagebox.h"

DefaultMessageBox::DefaultMessageBox(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::DefaultMessageBox)
{
    ui->setupUi(this);
    init();
}
DefaultMessageBox::DefaultMessageBox(QWidget *parent,QString windowTitle,QString content) :
    QDialog(parent),
    ui(new Ui::DefaultMessageBox)
{
    ui->setupUi(this);
    init();
    ui->titleL->setText(windowTitle);
    ui->contentL->setText(content);
}
void DefaultMessageBox::init()
{
    this->setWindowModality(Qt::WindowModal);
    this->setAttribute(Qt::WA_TranslucentBackground);
    this->setWindowFlag(Qt::FramelessWindowHint);
    QGraphicsDropShadowEffect *shadow = new QGraphicsDropShadowEffect(this);
    shadow->setColor(QColor(0,0,0,225));
    shadow->setBlurRadius(30);
    shadow->setOffset(0,0);
    ui->messageBoxW->setGraphicsEffect(shadow);
}
DefaultMessageBox::~DefaultMessageBox()
{
    delete ui;
}

void DefaultMessageBox::on_pushButton_clicked()
{
    this->close();
}
